package Class;

import com.sun.source.tree.IfTree;

import javax.swing.*;

public class Test {
    public static void main(String[] args) {
        String name = JOptionPane.showInputDialog(null,"输入姓名");
        String nameCheck = "[\\u4e00-\\u9fa5a-zA-Z]{2,}";
        if (name.matches(nameCheck)){
            JOptionPane.showMessageDialog(null,"合法");
        }else {
            JOptionPane.showMessageDialog(null,"非法");
            return;
        }

        String phNum = JOptionPane.showInputDialog(null,"输入电话号码");
        String phCheck = "1[3578][0-9]{9}";

        String birthday = JOptionPane.showInputDialog(null,"输入生日");
        String birthCheck = "[0-9]{4}-0[1-9]|1[0-2]{2}-(0-2)[0-9]||3[0-1]";
    }

}
